<?php namespace App\Admin\Cabinet\Cabinet;

use App\Core\Model as BaseModel;

class Model extends BaseModel {

    protected $table = 'cabinet';
    protected $primaryKey = 'id';
    
    //type对应关系
    public function type(){
        return $this->belongsTo('App\Admin\Cabinet\CabinetType\Model', 'type_id', 'id');
    }

    public function storefront(){
        return $this->belongsTo('App\Admin\Storefront\Storefront\Model', 'storefront_id', 'id');
    }
    
    public function cells(){
        return $this->hasMany('App\Admin\Cabinet\CabinetCell\Model', 'client_id', 'id');
    }
}